[chapterId].js 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871
  1. (() => {
  2. var exports = {};
  3. exports.id = 71452;
  4. exports.ids = [71452,64820];
  5. exports.modules = {
  6. /***/ 30583:
  7. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  8. "use strict";
  9. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  10. __webpack_require__.r(__webpack_exports__);
  11. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  12. /* harmony export */ "default": () => (/* binding */ pageWrapperTemplate),
  13. /* harmony export */ "getServerSideProps": () => (/* binding */ getServerSideProps),
  14. /* harmony export */ "getStaticPaths": () => (/* binding */ getStaticPaths),
  15. /* harmony export */ "getStaticProps": () => (/* binding */ getStaticProps)
  16. /* harmony export */ });
  17. /* harmony import */ var _sentry_server_config_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96270);
  18. /* harmony import */ var _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58097);
  19. /* harmony import */ var _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__);
  20. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20997);
  21. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
  22. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16689);
  23. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  24. /* harmony import */ var _xstate_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(59456);
  25. /* harmony import */ var _xstate_react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_xstate_react__WEBPACK_IMPORTED_MODULE_4__);
  26. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(59003);
  27. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_5__);
  28. /* harmony import */ var clipboard_copy__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(34741);
  29. /* harmony import */ var clipboard_copy__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(clipboard_copy__WEBPACK_IMPORTED_MODULE_6__);
  30. /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(71853);
  31. /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(next_router__WEBPACK_IMPORTED_MODULE_7__);
  32. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(60866);
  33. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_8__);
  34. /* harmony import */ var _index_module_scss__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(23848);
  35. /* harmony import */ var _index_module_scss__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(_index_module_scss__WEBPACK_IMPORTED_MODULE_27__);
  36. /* harmony import */ var _chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(65686);
  37. /* harmony import */ var _chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(_chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28__);
  38. /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(92684);
  39. /* harmony import */ var _components_AudioPlayer_Buttons_DownloadAudioButton__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(64881);
  40. /* harmony import */ var _components_NextSeoWrapper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(25869);
  41. /* harmony import */ var _dls_Button_Button__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(50497);
  42. /* harmony import */ var _dls_Spinner_Spinner__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7190);
  43. /* harmony import */ var _dls_Toast_Toast__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(79717);
  44. /* harmony import */ var _icons_copy_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(30135);
  45. /* harmony import */ var _icons_download_svg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(82184);
  46. /* harmony import */ var _icons_pause_svg__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(51512);
  47. /* harmony import */ var _icons_play_arrow_svg__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(27333);
  48. /* harmony import */ var _icons_reader_svg__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(45446);
  49. /* harmony import */ var _utils_cdn__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(17339);
  50. /* harmony import */ var _utils_chapter__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(95892);
  51. /* harmony import */ var _utils_eventLogger__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(55943);
  52. /* harmony import */ var _utils_navigation__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(57933);
  53. /* harmony import */ var _utils_url__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(69663);
  54. /* harmony import */ var _utils_validator__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(41051);
  55. /* harmony import */ var _xstate_actors_audioPlayer_selectors__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(16119);
  56. /* harmony import */ var _xstate_AudioPlayerMachineContext__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(64564);
  57. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_AudioPlayer_Buttons_DownloadAudioButton__WEBPACK_IMPORTED_MODULE_10__, _dls_Button_Button__WEBPACK_IMPORTED_MODULE_12__, _dls_Toast_Toast__WEBPACK_IMPORTED_MODULE_14__, _utils_eventLogger__WEBPACK_IMPORTED_MODULE_21__, _utils_navigation__WEBPACK_IMPORTED_MODULE_22__, _xstate_AudioPlayerMachineContext__WEBPACK_IMPORTED_MODULE_25__]);
  58. ([_components_AudioPlayer_Buttons_DownloadAudioButton__WEBPACK_IMPORTED_MODULE_10__, _dls_Button_Button__WEBPACK_IMPORTED_MODULE_12__, _dls_Toast_Toast__WEBPACK_IMPORTED_MODULE_14__, _utils_eventLogger__WEBPACK_IMPORTED_MODULE_21__, _utils_navigation__WEBPACK_IMPORTED_MODULE_22__, _xstate_AudioPlayerMachineContext__WEBPACK_IMPORTED_MODULE_25__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
  59. const RecitationPage = ({ selectedReciter , selectedChapter })=>{
  60. const { t , lang } = next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_8___default()();
  61. const toast = (0,_dls_Toast_Toast__WEBPACK_IMPORTED_MODULE_14__/* .useToast */ .pm)();
  62. const router = (0,next_router__WEBPACK_IMPORTED_MODULE_7__.useRouter)();
  63. const { 0: isDownloadingAudio , 1: setIsDownloadingAudio } = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
  64. const audioService = (0,react__WEBPACK_IMPORTED_MODULE_3__.useContext)(_xstate_AudioPlayerMachineContext__WEBPACK_IMPORTED_MODULE_25__/* .AudioPlayerMachineContext */ .c);
  65. const isAudioPlaying = (0,_xstate_react__WEBPACK_IMPORTED_MODULE_4__.useSelector)(audioService, (state)=>state.matches("VISIBLE.AUDIO_PLAYER_INITIATED.PLAYING"));
  66. const currentSurah = (0,_xstate_react__WEBPACK_IMPORTED_MODULE_4__.useSelector)(audioService, (state)=>state.context.surah);
  67. const currentReciterId = (0,_xstate_react__WEBPACK_IMPORTED_MODULE_4__.useSelector)(audioService, _xstate_actors_audioPlayer_selectors__WEBPACK_IMPORTED_MODULE_24__/* .selectCurrentAudioReciterId */ .BP);
  68. const isCurrentlyPlayingThisChapter = isAudioPlaying && currentSurah === Number(selectedChapter.id) && currentReciterId === selectedReciter.id;
  69. const onPlayAudioClicked = ()=>{
  70. audioService.send({
  71. type: "PLAY_SURAH",
  72. surah: Number(selectedChapter.id),
  73. reciterId: selectedReciter.id
  74. });
  75. };
  76. const onCopyLinkClicked = ()=>{
  77. (0,_utils_eventLogger__WEBPACK_IMPORTED_MODULE_21__/* .logButtonClick */ .MY)("share-recitation-copy-link");
  78. const path = (0,_utils_url__WEBPACK_IMPORTED_MODULE_26__/* .getCurrentPath */ .Jz)();
  79. if (origin) {
  80. clipboard_copy__WEBPACK_IMPORTED_MODULE_6___default()(path).then(()=>{
  81. toast(t("common:shared"), {
  82. status: _dls_Toast_Toast__WEBPACK_IMPORTED_MODULE_14__/* .ToastStatus.Success */ .YZ.Success
  83. });
  84. });
  85. }
  86. };
  87. const onReadClicked = ()=>{
  88. (0,_utils_eventLogger__WEBPACK_IMPORTED_MODULE_21__/* .logButtonClick */ .MY)("share-recitation-read");
  89. router.push((0,_utils_navigation__WEBPACK_IMPORTED_MODULE_22__/* .getSurahNavigationUrl */ .qm)(selectedChapter.id));
  90. };
  91. const onDownloadClicked = async ()=>{
  92. setIsDownloadingAudio(true);
  93. (0,_utils_eventLogger__WEBPACK_IMPORTED_MODULE_21__/* .logButtonClick */ .MY)("share-recitation-download");
  94. const audioData = await (0,_api__WEBPACK_IMPORTED_MODULE_9__/* .getChapterAudioData */ .lt)(Number(selectedReciter.id), Number(selectedChapter.id));
  95. (0,_components_AudioPlayer_Buttons_DownloadAudioButton__WEBPACK_IMPORTED_MODULE_10__/* .download */ .L)(audioData.audioUrl, ()=>{
  96. setIsDownloadingAudio(false);
  97. });
  98. };
  99. return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
  100. children: [
  101. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_components_NextSeoWrapper__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
  102. title: `${selectedReciter.translatedName.name} - ${selectedChapter.transliteratedName}`,
  103. description: t("reciter:reciter-chapter-desc", {
  104. surahName: selectedChapter.transliteratedName,
  105. reciterName: selectedReciter.translatedName.name
  106. }),
  107. canonical: (0,_utils_navigation__WEBPACK_IMPORTED_MODULE_22__/* .getCanonicalUrl */ .Z2)(lang, (0,_utils_navigation__WEBPACK_IMPORTED_MODULE_22__/* .getReciterChapterNavigationUrl */ .Y9)(selectedReciter.id.toString(), selectedChapter.slug))
  108. }),
  109. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
  110. className: classnames__WEBPACK_IMPORTED_MODULE_5___default()((_index_module_scss__WEBPACK_IMPORTED_MODULE_27___default().flow)),
  111. children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
  112. className: classnames__WEBPACK_IMPORTED_MODULE_5___default()((_index_module_scss__WEBPACK_IMPORTED_MODULE_27___default().flowItem), (_chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28___default().container)),
  113. children: [
  114. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("img", {
  115. className: (_chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28___default().reciterImage),
  116. alt: selectedReciter.translatedName.name,
  117. src: (0,_utils_cdn__WEBPACK_IMPORTED_MODULE_29__/* .makeCDNUrl */ .Kr)(selectedReciter.profilePicture)
  118. }),
  119. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
  120. children: [
  121. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
  122. className: (_chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28___default().chapterName),
  123. children: [
  124. selectedChapter.id,
  125. ". ",
  126. selectedChapter.transliteratedName
  127. ]
  128. }),
  129. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
  130. className: (_chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28___default().reciterName),
  131. children: selectedReciter.translatedName.name
  132. })
  133. ]
  134. }),
  135. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
  136. className: (_chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28___default().actionsContainer),
  137. children: [
  138. isCurrentlyPlayingThisChapter ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_dls_Button_Button__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP, {
  139. onClick: ()=>audioService.send("TOGGLE"),
  140. prefix: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_icons_pause_svg__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z, {}),
  141. className: (_chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28___default().playButton),
  142. children: t("common:audio.player.pause-audio")
  143. }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_dls_Button_Button__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP, {
  144. className: (_chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28___default().playButton),
  145. onClick: onPlayAudioClicked,
  146. prefix: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_icons_play_arrow_svg__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .Z, {}),
  147. shouldFlipOnRTL: false,
  148. children: t("common:audio.player.play-audio")
  149. }),
  150. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
  151. className: (_chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28___default().secondaryActionsContainer),
  152. children: [
  153. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_dls_Button_Button__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP, {
  154. className: (_chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28___default().secondaryAction),
  155. onClick: onReadClicked,
  156. prefix: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_icons_reader_svg__WEBPACK_IMPORTED_MODULE_19__/* ["default"] */ .Z, {}),
  157. type: _dls_Button_Button__WEBPACK_IMPORTED_MODULE_12__/* .ButtonType.Secondary */ .L$.Secondary,
  158. children: t("reciter:read")
  159. }),
  160. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_dls_Button_Button__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP, {
  161. className: (_chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28___default().secondaryAction),
  162. onClick: onCopyLinkClicked,
  163. prefix: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_icons_copy_svg__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {}),
  164. type: _dls_Button_Button__WEBPACK_IMPORTED_MODULE_12__/* .ButtonType.Secondary */ .L$.Secondary,
  165. children: t("reciter:copy-link")
  166. }),
  167. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_dls_Button_Button__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP, {
  168. className: (_chapterId_module_scss__WEBPACK_IMPORTED_MODULE_28___default().secondaryAction),
  169. onClick: onDownloadClicked,
  170. prefix: isDownloadingAudio ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_dls_Spinner_Spinner__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {}) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_icons_download_svg__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {}),
  171. type: _dls_Button_Button__WEBPACK_IMPORTED_MODULE_12__/* .ButtonType.Secondary */ .L$.Secondary,
  172. children: t("common:audio.player.download")
  173. })
  174. ]
  175. })
  176. ]
  177. })
  178. ]
  179. })
  180. })
  181. ]
  182. });
  183. };
  184. const getStaticProps$1 = async ({ params , locale })=>{
  185. try {
  186. const reciterId = params.reciterId;
  187. let chapterId = params.chapterId;
  188. const isValidId = (0,_utils_validator__WEBPACK_IMPORTED_MODULE_23__/* .isValidChapterId */ .hP)(chapterId);
  189. // if it's not a valid number or a number that exceed 114 or below 1
  190. if (!isValidId) {
  191. const sluggedChapterId = await (0,_api__WEBPACK_IMPORTED_MODULE_9__/* .getChapterIdBySlug */ .U0)(chapterId, locale);
  192. // if it's not a valid number nor a valid slug
  193. if (!sluggedChapterId) {
  194. return {
  195. notFound: true
  196. };
  197. }
  198. chapterId = sluggedChapterId;
  199. }
  200. const reciterData = await (0,_api__WEBPACK_IMPORTED_MODULE_9__/* .getReciterData */ .zm)(reciterId, locale);
  201. const chaptersData = await (0,_utils_chapter__WEBPACK_IMPORTED_MODULE_20__/* .getAllChaptersData */ .T4)(locale);
  202. const chapterData = await (0,_utils_chapter__WEBPACK_IMPORTED_MODULE_20__/* .getChapterData */ .dy)(chaptersData, chapterId);
  203. if (!reciterData || !chapterData) {
  204. return {
  205. notFound: true
  206. };
  207. }
  208. return {
  209. props: {
  210. chaptersData,
  211. selectedReciter: reciterData.reciter,
  212. selectedChapter: {
  213. ...chapterData,
  214. id: chapterId
  215. }
  216. }
  217. };
  218. // eslint-disable-next-line max-lines
  219. } catch (error) {
  220. return {
  221. notFound: true
  222. };
  223. }
  224. };
  225. const getStaticPaths = async ()=>({
  226. paths: [],
  227. fallback: "blocking"
  228. });
  229. var serverComponentModule = /*#__PURE__*/Object.freeze({
  230. __proto__: null,
  231. 'default': RecitationPage,
  232. getStaticProps: getStaticProps$1,
  233. getStaticPaths: getStaticPaths
  234. });
  235. /*
  236. * This file is a template for the code which will be substituted when our webpack loader handles non-API files in the
  237. * `pages/` directory.
  238. *
  239. * We use `__SENTRY_WRAPPING_TARGET_FILE__.cjs` as a placeholder for the path to the file being wrapped. Because it's not a real package,
  240. * this causes both TS and ESLint to complain, hence the pragma comments below.
  241. */
  242. const userPageModule = serverComponentModule ;
  243. const pageComponent = userPageModule ? userPageModule.default : undefined;
  244. const origGetInitialProps = pageComponent ? pageComponent.getInitialProps : undefined;
  245. const origGetStaticProps = userPageModule ? userPageModule.getStaticProps : undefined;
  246. const origGetServerSideProps = userPageModule ? userPageModule.getServerSideProps : undefined;
  247. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  248. const getInitialPropsWrappers = {
  249. '/_app': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapAppGetInitialPropsWithSentry,
  250. '/_document': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapDocumentGetInitialPropsWithSentry,
  251. '/_error': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapErrorGetInitialPropsWithSentry,
  252. };
  253. const getInitialPropsWrapper = getInitialPropsWrappers['/reciters/[reciterId]/[chapterId]'] || _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetInitialPropsWithSentry;
  254. if (pageComponent && typeof origGetInitialProps === 'function') {
  255. pageComponent.getInitialProps = getInitialPropsWrapper(origGetInitialProps) ;
  256. }
  257. const getStaticProps =
  258. typeof origGetStaticProps === 'function'
  259. ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetStaticPropsWithSentry(origGetStaticProps, '/reciters/[reciterId]/[chapterId]')
  260. : undefined;
  261. const getServerSideProps =
  262. typeof origGetServerSideProps === 'function'
  263. ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetServerSidePropsWithSentry(origGetServerSideProps, '/reciters/[reciterId]/[chapterId]')
  264. : undefined;
  265. const pageWrapperTemplate = pageComponent ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapPageComponentWithSentry(pageComponent ) : pageComponent;
  266. __webpack_async_result__();
  267. } catch(e) { __webpack_async_result__(e); } });
  268. /***/ }),
  269. /***/ 30135:
  270. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  271. "use strict";
  272. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  273. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  274. /* harmony export */ });
  275. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16689);
  276. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  277. var _rect, _path;
  278. function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
  279. var SvgCopy = function SvgCopy(props) {
  280. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  281. xmlns: "http://www.w3.org/2000/svg",
  282. width: 24,
  283. height: 24,
  284. viewBox: "0 0 24 24",
  285. fill: "none",
  286. stroke: "currentColor",
  287. strokeWidth: 2,
  288. strokeLinecap: "round",
  289. strokeLinejoin: "round",
  290. className: "feather feather-copy"
  291. }, props), _rect || (_rect = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  292. x: 9,
  293. y: 9,
  294. width: 13,
  295. height: 13,
  296. rx: 2,
  297. ry: 2
  298. })), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  299. d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"
  300. })));
  301. };
  302. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgCopy);
  303. /***/ }),
  304. /***/ 45446:
  305. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  306. "use strict";
  307. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  308. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  309. /* harmony export */ });
  310. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16689);
  311. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  312. var _path;
  313. function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
  314. var SvgReader = function SvgReader(props) {
  315. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  316. width: 24,
  317. height: 24,
  318. viewBox: "0 0 24 24",
  319. fill: "currentColor",
  320. xmlns: "http://www.w3.org/2000/svg"
  321. }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  322. d: "M3 .623v22.004c0 .165.067.324.186.44a.64.64 0 0 0 .448.183h17.332a.64.64 0 0 0 .448-.182.617.617 0 0 0 .186-.44V.622a.617.617 0 0 0-.186-.44.64.64 0 0 0-.448-.183H3.634a.64.64 0 0 0-.448.182.617.617 0 0 0-.186.44Zm10.146 13.493H7.227v-1.66h5.918v1.66Zm4.227-4.152H7.227v-1.66h10.146v1.66Zm0-4.152H7.227v-1.66h10.146v1.66Z"
  323. })));
  324. };
  325. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgReader);
  326. /***/ }),
  327. /***/ 65686:
  328. /***/ ((module) => {
  329. // Exports
  330. module.exports = {
  331. "container": "chapterId_container__1pGhS",
  332. "reciterImage": "chapterId_reciterImage__77FGp",
  333. "actionsContainer": "chapterId_actionsContainer___WGL9",
  334. "playButton": "chapterId_playButton__sE4yK",
  335. "secondaryActionsContainer": "chapterId_secondaryActionsContainer__HI3Bm",
  336. "secondaryAction": "chapterId_secondaryAction__lXerZ",
  337. "chapterName": "chapterId_chapterName__rAVTI",
  338. "reciterName": "chapterId_reciterName__tE57U"
  339. };
  340. /***/ }),
  341. /***/ 16119:
  342. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  343. "use strict";
  344. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  345. /* harmony export */ "BP": () => (/* binding */ selectCurrentAudioReciterId),
  346. /* harmony export */ "XL": () => (/* binding */ selectIsLoadingCurrentChapter),
  347. /* harmony export */ "eU": () => (/* binding */ selectIsVerseLoading),
  348. /* harmony export */ "iX": () => (/* binding */ selectIsUsingDefaultReciter),
  349. /* harmony export */ "sI": () => (/* binding */ selectIsPlayingCurrentChapter),
  350. /* harmony export */ "xU": () => (/* binding */ selectIsLoading)
  351. /* harmony export */ });
  352. /* unused harmony exports selectIsAudioPlaying, selectIsVerseBeingPlayed */
  353. /* harmony import */ var _redux_defaultSettings_defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  354. /* harmony import */ var _utils_verse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44519);
  355. /* eslint-disable import/prefer-default-export */
  356. const selectIsUsingDefaultReciter = (state)=>state.context.reciterId === _redux_defaultSettings_defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* .DEFAULT_RECITER.id */ .YS.id;
  357. const selectCurrentAudioReciterId = (state)=>state.context.audioData?.reciterId;
  358. const selectIsLoading = (state)=>state.hasTag("loading");
  359. const selectIsAudioPlaying = (state)=>state.matches("VISIBLE.AUDIO_PLAYER_INITIATED.PLAYING");
  360. const selectIsPlayingCurrentChapter = (state, chapterId)=>{
  361. const isAudioPlaying = selectIsAudioPlaying(state);
  362. const currentSurah = state.context.surah;
  363. return isAudioPlaying && currentSurah === chapterId;
  364. };
  365. const selectIsLoadingCurrentChapter = (state, chapterId)=>{
  366. const isLoading = selectIsLoading(state);
  367. const currentSurah = state.context.surah;
  368. return isLoading && currentSurah === chapterId;
  369. };
  370. const selectIsVerseBeingPlayed = (state, verseKey)=>{
  371. const { surah , ayahNumber } = state.context;
  372. return state.matches("VISIBLE.AUDIO_PLAYER_INITIATED.PLAYING") && makeVerseKey(surah, ayahNumber) === verseKey;
  373. };
  374. const selectIsVerseLoading = (state, verseKey)=>{
  375. const { surah , ayahNumber } = state.context;
  376. return selectIsLoading(state) && (0,_utils_verse__WEBPACK_IMPORTED_MODULE_1__/* .makeVerseKey */ .u)(surah, ayahNumber) === verseKey;
  377. };
  378. /***/ }),
  379. /***/ 75184:
  380. /***/ ((module) => {
  381. "use strict";
  382. module.exports = require("@reduxjs/toolkit");
  383. /***/ }),
  384. /***/ 58097:
  385. /***/ ((module) => {
  386. "use strict";
  387. module.exports = require("@sentry/nextjs");
  388. /***/ }),
  389. /***/ 59456:
  390. /***/ ((module) => {
  391. "use strict";
  392. module.exports = require("@xstate/react");
  393. /***/ }),
  394. /***/ 59003:
  395. /***/ ((module) => {
  396. "use strict";
  397. module.exports = require("classnames");
  398. /***/ }),
  399. /***/ 34741:
  400. /***/ ((module) => {
  401. "use strict";
  402. module.exports = require("clipboard-copy");
  403. /***/ }),
  404. /***/ 59606:
  405. /***/ ((module) => {
  406. "use strict";
  407. module.exports = require("humps");
  408. /***/ }),
  409. /***/ 12372:
  410. /***/ ((module) => {
  411. "use strict";
  412. module.exports = require("lodash/findKey");
  413. /***/ }),
  414. /***/ 98492:
  415. /***/ ((module) => {
  416. "use strict";
  417. module.exports = require("lodash/groupBy");
  418. /***/ }),
  419. /***/ 35526:
  420. /***/ ((module) => {
  421. "use strict";
  422. module.exports = require("lodash/random");
  423. /***/ }),
  424. /***/ 64042:
  425. /***/ ((module) => {
  426. "use strict";
  427. module.exports = require("lodash/range");
  428. /***/ }),
  429. /***/ 47657:
  430. /***/ ((module) => {
  431. "use strict";
  432. module.exports = require("lodash/sample");
  433. /***/ }),
  434. /***/ 16641:
  435. /***/ ((module) => {
  436. "use strict";
  437. module.exports = require("next-seo");
  438. /***/ }),
  439. /***/ 60866:
  440. /***/ ((module) => {
  441. "use strict";
  442. module.exports = require("next-translate/useTranslation");
  443. /***/ }),
  444. /***/ 3280:
  445. /***/ ((module) => {
  446. "use strict";
  447. module.exports = require("next/dist/shared/lib/app-router-context.js");
  448. /***/ }),
  449. /***/ 92796:
  450. /***/ ((module) => {
  451. "use strict";
  452. module.exports = require("next/dist/shared/lib/head-manager-context.js");
  453. /***/ }),
  454. /***/ 3539:
  455. /***/ ((module) => {
  456. "use strict";
  457. module.exports = require("next/dist/shared/lib/i18n/detect-domain-locale.js");
  458. /***/ }),
  459. /***/ 34014:
  460. /***/ ((module) => {
  461. "use strict";
  462. module.exports = require("next/dist/shared/lib/i18n/normalize-locale-path.js");
  463. /***/ }),
  464. /***/ 78524:
  465. /***/ ((module) => {
  466. "use strict";
  467. module.exports = require("next/dist/shared/lib/is-plain-object.js");
  468. /***/ }),
  469. /***/ 78020:
  470. /***/ ((module) => {
  471. "use strict";
  472. module.exports = require("next/dist/shared/lib/mitt.js");
  473. /***/ }),
  474. /***/ 64406:
  475. /***/ ((module) => {
  476. "use strict";
  477. module.exports = require("next/dist/shared/lib/page-path/denormalize-page-path.js");
  478. /***/ }),
  479. /***/ 24964:
  480. /***/ ((module) => {
  481. "use strict";
  482. module.exports = require("next/dist/shared/lib/router-context.js");
  483. /***/ }),
  484. /***/ 93431:
  485. /***/ ((module) => {
  486. "use strict";
  487. module.exports = require("next/dist/shared/lib/router/utils/add-locale.js");
  488. /***/ }),
  489. /***/ 11751:
  490. /***/ ((module) => {
  491. "use strict";
  492. module.exports = require("next/dist/shared/lib/router/utils/add-path-prefix.js");
  493. /***/ }),
  494. /***/ 46220:
  495. /***/ ((module) => {
  496. "use strict";
  497. module.exports = require("next/dist/shared/lib/router/utils/compare-states.js");
  498. /***/ }),
  499. /***/ 10299:
  500. /***/ ((module) => {
  501. "use strict";
  502. module.exports = require("next/dist/shared/lib/router/utils/format-next-pathname-info.js");
  503. /***/ }),
  504. /***/ 23938:
  505. /***/ ((module) => {
  506. "use strict";
  507. module.exports = require("next/dist/shared/lib/router/utils/format-url.js");
  508. /***/ }),
  509. /***/ 29565:
  510. /***/ ((module) => {
  511. "use strict";
  512. module.exports = require("next/dist/shared/lib/router/utils/get-asset-path-from-route.js");
  513. /***/ }),
  514. /***/ 35789:
  515. /***/ ((module) => {
  516. "use strict";
  517. module.exports = require("next/dist/shared/lib/router/utils/get-next-pathname-info.js");
  518. /***/ }),
  519. /***/ 1897:
  520. /***/ ((module) => {
  521. "use strict";
  522. module.exports = require("next/dist/shared/lib/router/utils/is-bot.js");
  523. /***/ }),
  524. /***/ 1428:
  525. /***/ ((module) => {
  526. "use strict";
  527. module.exports = require("next/dist/shared/lib/router/utils/is-dynamic.js");
  528. /***/ }),
  529. /***/ 28854:
  530. /***/ ((module) => {
  531. "use strict";
  532. module.exports = require("next/dist/shared/lib/router/utils/parse-path.js");
  533. /***/ }),
  534. /***/ 91292:
  535. /***/ ((module) => {
  536. "use strict";
  537. module.exports = require("next/dist/shared/lib/router/utils/parse-relative-url.js");
  538. /***/ }),
  539. /***/ 34567:
  540. /***/ ((module) => {
  541. "use strict";
  542. module.exports = require("next/dist/shared/lib/router/utils/path-has-prefix.js");
  543. /***/ }),
  544. /***/ 80979:
  545. /***/ ((module) => {
  546. "use strict";
  547. module.exports = require("next/dist/shared/lib/router/utils/querystring.js");
  548. /***/ }),
  549. /***/ 93297:
  550. /***/ ((module) => {
  551. "use strict";
  552. module.exports = require("next/dist/shared/lib/router/utils/remove-trailing-slash.js");
  553. /***/ }),
  554. /***/ 36052:
  555. /***/ ((module) => {
  556. "use strict";
  557. module.exports = require("next/dist/shared/lib/router/utils/resolve-rewrites.js");
  558. /***/ }),
  559. /***/ 84226:
  560. /***/ ((module) => {
  561. "use strict";
  562. module.exports = require("next/dist/shared/lib/router/utils/route-matcher.js");
  563. /***/ }),
  564. /***/ 95052:
  565. /***/ ((module) => {
  566. "use strict";
  567. module.exports = require("next/dist/shared/lib/router/utils/route-regex.js");
  568. /***/ }),
  569. /***/ 59232:
  570. /***/ ((module) => {
  571. "use strict";
  572. module.exports = require("next/dist/shared/lib/utils.js");
  573. /***/ }),
  574. /***/ 71853:
  575. /***/ ((module) => {
  576. "use strict";
  577. module.exports = require("next/router");
  578. /***/ }),
  579. /***/ 16689:
  580. /***/ ((module) => {
  581. "use strict";
  582. module.exports = require("react");
  583. /***/ }),
  584. /***/ 6022:
  585. /***/ ((module) => {
  586. "use strict";
  587. module.exports = require("react-redux");
  588. /***/ }),
  589. /***/ 20997:
  590. /***/ ((module) => {
  591. "use strict";
  592. module.exports = require("react/jsx-runtime");
  593. /***/ }),
  594. /***/ 14161:
  595. /***/ ((module) => {
  596. "use strict";
  597. module.exports = require("redux-persist");
  598. /***/ }),
  599. /***/ 82522:
  600. /***/ ((module) => {
  601. "use strict";
  602. module.exports = require("xstate");
  603. /***/ }),
  604. /***/ 44549:
  605. /***/ ((module) => {
  606. "use strict";
  607. module.exports = require("xstate/lib/actions");
  608. /***/ }),
  609. /***/ 31481:
  610. /***/ ((module) => {
  611. "use strict";
  612. module.exports = import("@radix-ui/react-dropdown-menu");;
  613. /***/ }),
  614. /***/ 66704:
  615. /***/ ((module) => {
  616. "use strict";
  617. module.exports = import("@radix-ui/react-tooltip");;
  618. /***/ }),
  619. /***/ 88813:
  620. /***/ ((module) => {
  621. "use strict";
  622. module.exports = import("firebase/compat/analytics");;
  623. /***/ }),
  624. /***/ 33773:
  625. /***/ ((module) => {
  626. "use strict";
  627. module.exports = import("firebase/compat/app");;
  628. /***/ }),
  629. /***/ 3590:
  630. /***/ ((module) => {
  631. "use strict";
  632. module.exports = import("react-toastify");;
  633. /***/ }),
  634. /***/ 63477:
  635. /***/ ((module) => {
  636. "use strict";
  637. module.exports = require("querystring");
  638. /***/ })
  639. };
  640. ;
  641. // load runtime
  642. var __webpack_require__ = require("../../../webpack-runtime.js");
  643. __webpack_require__.C(exports);
  644. var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
  645. var __webpack_exports__ = __webpack_require__.X(0, [11497,79165,96270,24709,57933,61239,25869,50497,76410,79717,85949,41051,99163,64564,9581,4075], () => (__webpack_exec__(30583)));
  646. module.exports = __webpack_exports__;
  647. })();
  648. //# sourceMappingURL=[chapterId].js.map